package com.project.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.project.bean.EmailBean;
import com.project.bean.ReceiveBean;
import com.project.bean.UserBean;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDate;
import java.util.List;

public interface IEmailService {
    /**
     * 添加电子邮件
     *
     * @param email    电子邮件对象
     * @param IdList id列表
     * @param userList 用户列表
     */
    public void addEmail(EmailBean email,List<String> userList,List<Integer> IdList);


    /**
     * 发件箱查单个邮件
     *
     * @param emailId 电子邮件id
     * @return {@code EmailBean} 邮件对象
     */
    public EmailBean sendFindEmail(Integer emailId);

    /**
     * 发件箱删除邮件
     *
     * @param email 邮件对象
     */
    public void sendDel(EmailBean email);

    public IPage<EmailBean> sendCutByItems(@Param("theme") String theme, @Param("startDate")LocalDate startDate,
                                           @Param("endDate") LocalDate endDate,@Param("authorId") Integer authorId,@Param("pageNO") Integer pageNO);


    /**
     * 自定义分页查询
     * 按当前用户id，动态条件分页查询收件
     * @param pageNO 页码
     * @param theme 主题
     * @param startDate 起始日期
     * @param endDate 结束日期
     * @param userId 当前用户id
     * @return 分页对象
     */
    public IPage<ReceiveBean> cutByItem(Integer pageNO, String theme, LocalDate startDate, LocalDate endDate, Integer userId);

    public EmailBean receiveReadEmail(@Param("emailId") Integer emailId,@Param("receiverId") Integer receiverId);

    public void receiveDel(@Param("emailId") Integer emailId,@Param("receiverId") Integer receiverId);
}
